<template>
  <div class="container-item-tags">
    <el-tag v-for="(temp,index) in list" :key="index" class="item-tag" size="mini">{{ valueKey?temp[valueKey]:temp }} </el-tag>
  </div>
</template>

<script>
export default {
  props: {
    value: {
      type: [String, Array],
      default: ''
    },
    valueKey: {
      type: [String, Boolean],
      default: false
    }
  },
  computed: {
    list() {
      if (this.value instanceof Array) {
        return this.value;
      }
      return this.value ? this.value.split(',') : [];
    }
  }
};
</script>

<style lang="scss" scoped>
.item-tag {
  margin-right: 5px;
}
</style>
